package com.Maykk.charStream;

import java.io.*;

/**
 * @ClassName: Demo08
 * @Description: TODO 缓冲区字符流复制文件
 * @Author: MaykkStar@163.com
 */
public class Demo07 {
    public static void main(String[] args) throws IOException {
        final String SRC = "./Maykk.txt";
        final String TO = "./MaykkNew.txt";
        BufferedReader br = new BufferedReader(new FileReader(SRC));
        BufferedWriter bw = new BufferedWriter(new FileWriter(TO));

        char[] chars = new char[1024];
        int len;
        while((len = br.read(chars)) != -1) {
            bw.write(chars,0,len);
            bw.flush();
        }

        br.close();
        bw.close();
    }
}
